#include <iostream>
#include <string>
#include <strstream>
#include <vector>
#include <map>
#include <fstream>
#include <time.h>
#include "cljas_polarity.h"
using namespace std;

int main()
{
	LoadDict();
	term_frequency("train_elec_en.txt", "train_elec_cn.txt");

	model cllda;
	cllda.datafile_src = "train_elec_en.txt"; 
	cllda.datafile_tgt = "train_elec_cn.txt";
        cllda.datafile_new_src = "test_elec_en.txt"; 
	cllda.datafile_new_tgt = "test_elec_cn.txt";


	cllda.senti_file_src = "sentiment_en.txt"; 
	cllda.senti_file_tgt = "sentiment_cn.txt";
	

	cllda.K=14;
	cllda.alpha_src = 50.0/cllda.K; 
	cllda.alpha_tgt = 50.0/cllda.K;
    cllda.beta_src = 0.1; 
	cllda.beta_tgt = 0.1;
	cllda.pai1_src = 0.1; 
	cllda.pai1_tgt = 0.1;
    cllda.gamma_src_src = 0.001; 
	cllda.gamma_src_tgt = 0.001;
	cllda.gamma_tgt_src = 1;
	cllda.gamma_tgt_tgt = 0.001;
    cllda.twords = 20; //top words per each topic
	cllda.niters =100; // number of Gibbs sampling iterations
	cllda.niters_infer=10;

	cllda.init();
	
	cllda.get_trans_result();
	cllda.estimate();
	//cllda.niters_infer=10;
	//cllda.init_infer();
	//cllda.inference();
	
	cllda.save_model_twords_src("topic_words_en.txt");

	cllda.save_model_twords_tgt("topic_words_zh.txt");

    system("pause");
	return 0;

}
